﻿using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
using NoobOS.FileSystem.Physical;
using NoobOS.FileSystem.Physical.Drivers;
using NoobOS;
using CosmosKernel1.IO;
using Cosmos.Hardware;
namespace CosmosKernel1
{
    public class Kernel : Sys.Kernel
    {
        public static VGAScreen scr = new VGAScreen();
        public static Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII svga = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();

        public void drawRect(uint x, uint y, uint length, uint height, uint c)
        {
            for (uint l = 1; l <= length; l++)
            {
                for (uint h = 1; h <= height; h++)
                {
                    scr.SetPixel320x200x8((uint)x + l, (uint)y + h, (uint)c);
                }
            }
        }

        public static void DrawFrameColor(uint[] Arr, int width, int length, int xpixel, int ypixel, int color)
        {
            int count = 0;
            for (int i = 0; i < length; i++)
            {
                for (int t = 0; t < width; t++, count++)
                {
                    if (Arr[count] == 1)
                    {
                        scr.SetPixel((uint)(0 + (uint)t + 0 + (uint)xpixel), (uint)(0 + (uint)i + 0 + (uint)ypixel), (uint)color);
                    }
                }
            }
        }

        protected override void BeforeRun()
        {
           

       
       
            Console.WriteLine("AndOS is loading...Please wait.");
        
        }
        

        protected override void Run()
        {
            Console.Clear();
           // IO.Filesystem.FilesystemManager.Init(Cosmos.Hardware.BlockDevice.Partition);
            Init.RunInit();
      
            CosmosKernel1.Core.Init.init();
        
        
       
        }
    }
}
